package com.hyc.myvideo.ui.view;

import android.view.Gravity;
import android.view.View;

import com.hyc.myvideo.R;
import com.hyc.myvideo.ui.base.BaseDialogFragment;

import butterknife.OnClick;

/**
 * @author 弹框提示-照片选择
 * @version 1.0
 * @created 2017/8/11
 */

public class DialogPhoto extends BaseDialogFragment {
    private photoInterface pInterface;
    public DialogPhoto(photoInterface payInterface1) {
        this.pInterface = payInterface1;
    }

    @Override
    public int getContentViewId() {
        return R.layout.dialog_photo;
    }

    @Override
    public int getGravity() {
        return Gravity.BOTTOM;
    }

    @Override
    public boolean isAnimations() {
        return true;
    }

    @Override
    protected void initView() {

    }

    @OnClick({R.id.dialog_photo_pictures, R.id.dialog_photo_album, R.id.dialog_photo_exit})
    public void onClick(View v) {
       switch (v.getId()){
           //拍照
           case R.id.dialog_photo_pictures:
               pInterface.onPictures();
               hideDialog();
               break;
           //相册
           case R.id.dialog_photo_album:
               pInterface.onAlbum();
               hideDialog();
               break;
           //取消
           case R.id.dialog_photo_exit:
                hideDialog();
               break;
       }
    }

    public interface photoInterface{
        //拍照
        void onPictures();
        //相册
        void onAlbum();
    }


}
